from datetime import datetime

str_time='2018-12-17 02:00:00'
datetime_time=datetime.strptime(b,'%Y-%m-%d %H:%M:%S')
# datetime.datetime(2018, 12, 17, 2, 0)